<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>第三题</title>
</head>

<body>
    <script>
        function getArray() {
            const arr = [2000, 2004, 2009, 2010, 2011, 2022]
            const newArray = []
            for (let i = 0; i < arr.length; i++) {
                if (arr[i] % 4 == 0) {
                    newArray.push(arr[i])
                }
            }
            return newArray
        }
        let arr1 = getArray()
        console.log(arr1)
    </script>
</body>

</html>